The present invention relates to an imaging device, a method for controlling an imaging device, an information storage device, and the like.
An endoscope system having a zoom function has been put to practical use, the endoscope system being configured so that the entire digestive tract (object) is observed on the wide-angle (WIDE) side (normal observation), and part of the digestive tract is observed in a zoom state on the telescopic (TELE) side (zoom observation) by adjusting the angle of view of the objective lens by moving a movable lens.
The endoscope system having a zoom function is normally configured to implement the magnification necessary for zoom observation by moving the movable lens to reduce the angle of view on the TELE side (i.e., increase the optical magnification) while adjusting the in-focus object plane position. Specifically, the object can be more closely observed by designing the objective lens so that the in-focus object plane position decreases on the TELE side, and the magnification during zoom observation can be increased.
The moving amount of the image position due to the movement of the position of the object increases as the distance from the objective lens to the in-focus object plane position decreases, and the depth of field of the optical system normally becomes shallow. Therefore, the TELE-side depth of field of the endoscope system having a zoom function may be 1 mm or less, and it may be difficult for the user to bring the object into focus. In order to solve the above problem, JP-A-2004-294788 proposes an endoscope system that calculates a contrast value (i.e., an evaluation value that indicates the degree of in-focus of the image) from the high-frequency component of the image to evaluate the in-focus state, and performs an autofocus (AF) operation, for example. JP-A-10-239579 proposes a video camera having a function (full-time AF function) that calculates a contrast value while wobbling the focus lens to detect the in-focus direction, and cyclically moves the focus lens in the in-focus direction to continuously bring the object into focus so as to follow the object in a movie.
It is difficult to maintain the distance (object distance) from the objective lens to the object to be constant during zoom observation using an endoscope due to pulsation of the object and the like. Therefore, even if the user has temporarily brought the object into focus using a single AF operation, the object becomes out of focus due to a change in the object distance, and observation by the user is hindered.
It is desirable to perform the full-time AF operation as disclosed in JP-A-10-239579 in order to solve the above problem.